from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.types import Date, Text, Integer
from aps import app
from aps import config

# an Engine, which the Session will use for connection
# resources
engine = create_engine(app.config['DATABASE'])
# engine = create_engine('postgresql://is2:1234@localhost:5432/is2bd')
# engine = create_engine('postgresql://is2:1234@localhost:5432/is2bdproduccion')
Base = declarative_base()
# Base.metadata.create_all(engine)

# create a configured "Session" class
DBSession = sessionmaker(autocommit=True, bind=engine)

# create a Session
bdsession = DBSession()
